package com.zmn.plat.admin.controller.part;

import java.util.List;
import java.util.stream.Collectors;

import javax.annotation.Resource;

import com.zmn.common.dto.VtDTO;
import com.zmn.plat.admin.controller.PlatBaseController;
import com.zmn.plat.business.interfaces.part.PartSkuBService;
import com.zmn.plat.business.interfaces.part.category.PartCategoryBService;
import com.zmn.plat.model.entity.brand.BaseBrand;
import com.zmn.plat.services.interfaces.brand.BaseBrandService;
import com.zmn.plat.services.interfaces.category.BaseCategoryService;
import com.zmn.plat.services.interfaces.part.*;

// import com.zmn.plat.manager.interfaces.cache.PartCategoryCache;

/**
 * 类描述： PartBaseController
 *
 * @author DaiZhichao
 * @since 2018/12/8 16:09
 */
public class PartBaseController extends PlatBaseController {

    @Resource
    protected PartSkuService partSkuService;
    @Resource
    protected PartCategoryBService partCategoryBService;
    @Resource
    protected PartSkuBService partSkuBService;
    @Resource
    protected PartCategoryService partCategoryService;
    @Resource
    protected PartSkuPriceService partSkuPriceService;
    @Resource
    protected PartCategoryMapService partCategoryMapService;
    @Resource
    protected BaseBrandService brandService;
    @Resource
    protected BaseCategoryService baseCategoryService;
    @Resource
    protected PartSkuRelationService partSkuRelationService;
    @Resource
    protected PartSkuUnitService partSkuUnitService;

    /**
     * 描述:调用【品牌】服务，返回【配件品牌】简单列表
     *
     * @return List<VtDTO>
     * @author DaiZhichao
     * @since 2018/11/7 15:13
     */
    protected List<VtDTO> getBrandSimpleList() {
        List<BaseBrand> brandList = brandService.listAll();
        return brandList.stream().map(baseBrand -> new VtDTO(baseBrand.getBrandId(), baseBrand.getName(), baseBrand.getStatus()))
            .collect(Collectors.toList());
    }
}
